<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>设置我的资料</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layui/layuiAdmin/css/admin.css" media="all">
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header"><h2>个人信息</h2></div>
          <div class="layui-card-body" pad15>
            
            <div class="layui-form" lay-filter="">
              <div style="width: 132px;">
                  <div class="layui-form-item">
                      <label class="layui-form-label">用户头像</label>
                  </div>
               <div class="layui-form-item">
                  <img class="layui-upload-img" id="ID-upload-demo-img" style="width: 100%; height: 92px;">
                   <div id="ID-upload-demo-text"></div>
               </div>
<!--                <div class="layui-upload-list">-->
<!--                  <label class="layui-form-label">用户头像</label>-->
<!--                </div>-->
                <div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-demo">
                  <div class="layui-progress-bar" lay-percent=""></div>
                </div>
                <button type="button" class="layui-btn" id="ID-upload-demo-btn">
                  <i class="layui-icon layui-icon-upload"></i> 上传头像
                </button>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">账户名称</label>
                <div class="layui-input-inline">
                  <input type="text" name="username" value="xianxin" readonly class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">不可修改。一般用于后台登入名</div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                  <input type="password" name="nickname"  lay-verify="nickname" autocomplete="off" placeholder="请输入密码" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                  <input type="text" name="nickname"  lay-verify="nickname" autocomplete="off" class="layui-input">
                </div>
              </div>
<!--              <div class="layui-form-item">-->
<!--                <label class="layui-form-label">性别</label>-->
<!--                <div class="layui-input-block">-->
<!--                  <input type="radio" name="sex" value="男" title="男">-->
<!--                  <input type="radio" name="sex" value="女" title="女" checked>-->
<!--                </div>-->
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">联系方式</label>
                <div class="layui-input-inline">
                  <input type="text" name="cellphone" value="" lay-verify="phone" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">年龄</label>
                <div class="layui-input-inline">
                  <input type="text" name="email" value="" lay-verify="email" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                  <textarea name="remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
                </div>
              </div>
              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit lay-filter="setmyinfo">确认修改</button>
                  <button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
                </div>
              </div>
            </div>
            
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="../../layui/layui.js"></script>
  <script>
    layui.use(function(){
      var upload = layui.upload;
      var layer = layui.layer;
      var element = layui.element;
      var $ = layui.$;
      // 单图片上传
      var uploadInst = upload.render({
        elem: '#ID-upload-demo-btn',
        url: '', // 实际使用时改成您自己的上传接口即可。
        before: function(obj){
          // 预读本地文件示例，不支持ie8
          obj.preview(function(index, file, result){
            $('#ID-upload-demo-img').attr('src', result); // 图片链接（base64）
          });

          element.progress('filter-demo', '0%'); // 进度条复位
          layer.msg('上传中', {icon: 16, time: 0});
        },
        done: function(res){
          // 若上传失败
          if(res.code > 0){
            return layer.msg('上传失败');
          }
          // 上传成功的一些操作
          // …
          $('#ID-upload-demo-text').html(''); // 置空上传失败的状态
        },
        error: function(){
          // 演示失败状态，并实现重传
          var demoText = $('#ID-upload-demo-text');
          demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
          demoText.find('.demo-reload').on('click', function(){
            uploadInst.upload();
          });
        },
        // 进度条
        progress: function(n, elem, e){
          element.progress('filter-demo', n + '%'); // 可配合 layui 进度条元素使用
          if(n == 100){
            layer.msg('上传完毕', {icon: 1});
          }
        }
      });
    });

  </script>

</body>
</html>